//package TrafficControlSystem.TrafficLights;
//
//import java.awt.event.*;
//import javax.swing.*;
//
//import TrafficControlSystem.TrafficSimulator.Crossing;
//
//public class TimerForLights  implements ActionListener
//{
//    static int cycleTime=20;
//    Timer timer;
//    LightsControlPanel panel;
//    
//    public TimerForLights(LightsControlPanel apanel)
//    {
//    	panel=apanel;
//        timer = new Timer(cycleTime, this);
//        timer.start();
//    }
//    
//    public void actionPerformed(ActionEvent e)
//    {
//    	for (int i=0;i<9;i++)
//    	{
//    		if(panel.getTrafficLightsController().getCrossing(i).getRoadLightHorizontal().isGreen()) panel.setButtonColorToGreen(i);
//    		else panel.setButtonColorToRed(i);
//    		panel.getTrafficLightsController().Calculate();
//    	}
//
//    }
//	
//}